package codejam._2014.cookie_clicker;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Solution {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int T = Integer.parseInt(br.readLine());
		for (int t = 0; t < T; t++) {
			String[] s = br.readLine().split(" ");
			double C = Double.parseDouble(s[0]);
			double F = Double.parseDouble(s[1]);
			double X = Double.parseDouble(s[2]);
			solve(t + 1, C, F, X);
		}

	}

	static void solve(int t, double C, double F, double X) {
		System.out.printf("%f, %f, %f\n", C, F, X);

		double rate = 2;

		double sum = 0;

		for (int i = 0; i < 10; i++) {
			System.out.println("sum = " + sum + ", rate = " + rate);
			double r1 = X  / 2;
			double r2 = sum + (C / rate) + (X / (rate + F));
			System.out.println("r1 = " + r1 + ", r2 = " + r2);
			if (Double.compare(r1, r2) > 0) {
				// choose r2
				sum = sum + (C/rate);
				rate += F;
				System.out.println(sum + ", if1");
			} else if (Double.compare(r1, r2) < 0) {
				sum = r1;
				System.out.println(sum + ", if2");
			}
			
		}
	}

}
